<?php

/**
 * 数据库类
 *
 */
class DataBase {
    
    public $dblink = '';
    public $dns = "mysql:dbname=cnstanza;host=localhost";
    public $user = 'cnstanza';
    public $passwd = 'sawVMRSsjbtsa47x';
    
    public function __construct() {
        $this->dblink = new PDO($this->dns, $this->user, $this->passwd) or die('error!');
        $this->dblink->query("set names utf8");
    }
    
    public function query($query) {
        return $this->dblink->query($query);
        
    }
    
    public function fetchAll($result) {
        return $result->fetchAll();
    }
    
    

    
}
